Page({
  data: {
    name: "用户名",
    age: "25岁",
    gender: "男",
    address: "北京市朝阳区某某小区"
  },
  onLoad() {
    const userInfo = wx.getStorageSync('userInfo');
    if (userInfo) {
      this.setData({
        name: userInfo.realName || "未设置昵称",  // 显示“杨先生”
        age: userInfo.age ? `${userInfo.age}岁` : "未知年龄",  // 显示“45岁”
        gender: userInfo.gender === 1 ? "男" : "女",  // 你的数据中gender是1，对应“男”
        address: userInfo.address || "未设置地址" ,  // 显示“北京市朝阳区”
        avatar:userInfo.healthCertificate
      });
    }
    // 页面加载时的逻辑，比如获取用户信息等
  },
  // 点击“我的发布”按钮的事件处理函数
  handleMyPublish() {
    wx.navigateTo({
      url: "/pages/myPublish/myPublish",
    });
  },
  // 点击“已接单”按钮的事件处理函数
  handleAccepted() {
    wx.navigateTo({
      url: "/pages/accepted/accepted",
    });
  },
  // 点击“进行中”按钮的事件处理函数
  handleInProgress() {
    wx.navigateTo({
      url: "/pages/inProgress/inProgress",
    });
  },
  // 点击“已完成”按钮的事件处理函数
  handleCompleted() {
    wx.navigateTo({
      url: "/pages/completed/completed",
    });
  },
  handleqian() {
    wx.navigateTo({
      url: "/pages/myqian/myqian",
    });
  },
  // 点击“优惠券”按钮的事件处理函数
  handleCoupons() {
    wx.navigateTo({
      url: "/pages/youhuiquan/youhuiquan",
    });
  },
  // 点击“关于我们”按钮的事件处理函数
  handleAboutUs() {
    wx.navigateTo({
      url: "/pages/withdraw/withdraw",
    });
  },
  // 点击“个人中心”按钮的事件处理函数
  handlePersonalCenter() {
    wx.navigateTo({
      url: "/pages/personalCenter/personalCenter",
    });
  },
  // 点击“护理认证”按钮的事件处理函数
  handleNursingCertification() {
    wx.navigateTo({
      url: "/pages/nursingCertification/nursingCertification",
    });
  },
  // 点击“提现”按钮的事件处理函数
  handleWithdraw() {
    wx.navigateTo({
      url: "/pages/withdraw/withdraw",
    });
  },
  // 点击“联系我们”按钮的事件处理函数
  handleContactUs() {
    wx.navigateTo({
      url: "/pages/contactUs/contactUs",
    });
  },
});
    